home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / STANDALO / SPROING! / SPROING_.C1 < prev    next >
Text File  |  1990-10-27  |  1KB  |  61 lines

  1. /*_________________________________________________________________________
  2.  
  3.         Sproing VBL Tester
  4.         
  5.         October 1990
  6.         
  7.         ⌐1990 Scott Armitage
  8.     
  9.         Written for Think C
  10.  
  11.     This application will install the Sproing VBL task and run it until
  12.     the mouse is clicked.  This lets us experiment with the dynamics of
  13.     the vbl without the arduous task of running an INIT.
  14.     
  15.     The Sproing VBL should be compiled and merged with the
  16.     "Sproing Tester.rsrc" file prior to running this application.
  17.     
  18. _________________________________________________________________________*/
  19.  
  20. #include "VRetraceMgr.h"
  21.  
  22. extern Point MouseOffset : 0x8DA;
  23.  
  24. /*_____________________________________________________________________*/
  25. main()
  26. {
  27.     Handle ourCode;
  28.     VBLQElPtr vblPtr;
  29.     
  30.     InitGraf(&thePort);                            /* init the toolbox */
  31.     InitFonts();
  32.     InitWindows();
  33.     InitMenus();
  34.     TEInit();
  35.     InitDialogs(0);
  36.     InitCursor();
  37.  
  38.     ourCode = GetResource('vbl ', 999);            /* load the VBL */
  39.     HLock(ourCode);
  40.     
  41.     vblPtr = (VBLQElPtr) NewPtr(sizeof(VBLTask)); /* make our VBL task */
  42.     if (vblPtr == 0) {
  43.         SysBeep(5);
  44.         ExitToShell();
  45.     }
  46.     vblPtr->qType = vType;
  47.     vblPtr->vblAddr = (ProcPtr) *ourCode;
  48.     vblPtr->vblCount = 1;
  49.     vblPtr->vblPhase = 0;
  50.     
  51.     if (VInstall(vblPtr)!= 0)                    /* install it */
  52.         DebugStr("\pNo Install");
  53.     
  54.     while(!Button())                            /* wait for click */
  55.         ;
  56.     VRemove(vblPtr);                            /* remove the vbl task */
  57.     
  58.     MouseOffset.h = 0;                            /* restore the mouse offsets */
  59.     MouseOffset.v = 0;
  60. }
  61.